﻿using System;
using System.Collections.Generic;
using System.Text;
using EnCor.ObjectBuilder;
using System.Configuration;

namespace EnCor.Security
{
    public class AuthenticationExtensionFactory :
        AssemblerBasedObjectFactory<AuthenticationExtension, AuthenticationExtensionConfig>
    {
        public override AuthenticationExtension Create(IBuilderContext context, AuthenticationExtensionConfig objectConfiguration)
        {
            if (objectConfiguration.Type == null)
            {
                throw new ConfigurationErrorsException();
            }
            return (AuthenticationExtension)Activator.CreateInstance(objectConfiguration.Type);
        }
    }
}
